package cn.formal.service;

import cn.formal.entity.Result;
import cn.formal.service.impl.SearchServiceImpl;
import cn.formal.vi.QuestionAnswer;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

@Service
@FeignClient(value = "search-service",fallback = SearchServiceImpl.class/*,
        configuration = FeignLogConfig.class*/  //声明feign日志级别配置,可以省略不写
) //编写调用服务的应用名称,应用名称不能带下划线
public interface SearchService {
    @PostMapping("question/addDoc")
    Result addDoc(@RequestBody QuestionAnswer answer);
    @GetMapping("question/findById")
    Result findById(@RequestParam("id")Long id);
    @PostMapping("question/update")
    Result update(@RequestBody QuestionAnswer answer);
    @GetMapping("question/deleteById")
    Result deleteById(@RequestParam("id")Long id);
    @GetMapping("question/deleteAll")
    Result deleteAll();
    @GetMapping("question/findByTitle")
    Result findByTitle(@RequestParam("title")String title);
    @GetMapping("question/findAll")
    Result findAll(@RequestParam("page")Integer page, @RequestParam("size") Integer size);
}
